class Student:
    def __init__(self, name, age):
        self.name = name
        self.age = age
        self.subject = None

    def get_subject(self):
        subject = input("你学的啥学科\n")
        self.subject = subject


if __name__ == '__main__':
    s1 = Student("小美", 18)
    print(s1.subject)
    s1.get_subject()
    print(s1.subject)
